function doQueries(year, month, order){
    
    var url = 'queries/doQueries';
	
    $("#the_content").html('');
    $("#the_waiting").html('<img src = "../images/spinner.gif" />');
    $.post(url, {
        year:year,
        month:month,
        order:order
    }, function(data) {
		if($("#the_waiting") == undefined && $("#the_content") == undefined){	
			location.reload(true);
		} else {
				$("#the_waiting").html('');
				$("#the_content").html(data).fadeIn();
		}
    }, "html");
}

function doContactList(order){
    
    var url = 'queries/doContactList';
	
    $("#the_content").html('');
    $("#the_waiting").html('<img src = "../images/spinner.gif" />');
    $.post(url, {
        order:order
    }, function(data) {
        $("#the_waiting").html('');
        $("#the_content").html(data).fadeIn();
    }, "html");
}

function printPartOfPage(elementId)
{
	var content = document.getElementById("printer_session").innerHTML;
	$("#printer_session").html('');
	
    var printContent = document.getElementById(elementId);
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=50,top=50,width=500,height=500');

    printWindow.document.write(printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();
	
	$("#printer_session").html(content);
	
}